/**
 * 折中式的 后端菜单管理, 先把所有路由都写在这里,然后用 { access: 'server' } 配置是否采用后台控制该菜单
 * 在app.tsx中, 当patchClientRoutes中获取用户的菜单列表出现此菜单时, 将此菜单的access属性删除(delete)之, 否则保留之(那么菜单就会被限制住)
 */
export default [
	{
		path: '/user',
		layout: false,
		routes: [{ name: '登录', path: '/user/login', component: './user/login' }],
	},
	{ path: '/welcome', name: '欢迎', icon: 'smile', component: './Welcome' },
	{
		path: '/admin',
		name: '管理页',
		icon: 'crown',
		access: 'canAdmin',
		routes: [
			{ path: '/admin', redirect: '/admin/sub-page' },
			{ path: '/admin/sub-page', name: '二级管理页', component: './Admin' },
		],
	},
	{ name: '查询表格', icon: 'table', path: '/list', component: './table-list' },
	{
		name: '案例页面',
		icon: 'usb',
		path: '/demo1',
		component: './demo',
		access: 'server', //后端控制菜单
	},
	{
		name: '开始页面',
		icon: 'tool',
		path: '/start',
		component: './start/start.tsx',
		access: 'server', //后端控制菜单
	},
	{ path: '/', redirect: '/welcome' },
	{ path: '*', layout: false, component: './404' },
];
